<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>

<style>
.bt_view {
	background-color: #8099de;
	border: 1px solid #999;
	width: 80px;
	height: 20px;
	border-radius: 8px;
	border: none;
	margin: 0 0 0 5px;
	font-weight: bold;
	font-size: 0.9em;
	color: #FFF;
	background-image: url(../images/member/dup.jpg);
	background-repeat: repeat-x;
	background-position: center center;
}
.bt_view_small {
	background-color: #8099de;
	border: 1px solid #999;
	width: 40px;
	height: 18px;
	border-radius: 8px;
	border: none;
	margin: 0 0 0 5px;
	font-weight: bold;
	font-size: 0.8em;
	color: #FFF;
	background-image: url(../images/member/dup.jpg);
	background-repeat: repeat-x;
	background-position: center center;
}
</style>


<div id="member_page">
	<header>
		<div id="title">
			<b>Information</b>
		</div>

		<div id="bar"></div>
	</header>

	<section id="member_form">
		<table id="table-simple" summary="사용자 등록 결과">
			<tr>
				<th width="120">코스번호</th>
				<td width="460">${course.courseId }</td>
			</tr>
			<tr>
				<th>코스이름</th>
				<td>${course.courseName }</td>
			</tr>
			<tr>
				<th>강의실</th>
				<td>${course.classRoom }</td>
			</tr>

			<tr>
				<th>시작날짜</th>
				<td>${course.startDate }</td>
			</tr>
			<tr>
				<th>종료날짜</th>
				<td>${course.endDate }</td>
			</tr>
			<tr>
				<th>과목 리스트</th>
				<td><c:forEach items="${course.subjectList }" var="subject">
					${subject.title }<br>
					</c:forEach></td>
			</tr>
		</table>
		
				<table id="table-simple" summary="사용자 등록 결과">
			<tr>
		<sec:authorize ifAllGranted="ROLE_EMPLOYEE">

			<p align="center">
			<form method="POST" action="<c:url value="/course/modifyCourse"/>">
				<input name="courseId" type="hidden" value="${course.courseId }" />
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
				&nbsp;&nbsp;&nbsp;
				<input type="submit" value="수정하기" class="bt_view"/>
				<p>
			</form>


			<b>신청한 사람</b>

		<div id="bar"></div>
				</sec:authorize>


				<td><c:forEach items="${membersOfCourse.memberList }" var="members">
						<table>
							<tr>
								<td width="400px">${members.name }&nbsp;&nbsp;${members.phoneNumber
									}&nbsp;&nbsp;${members.email }</td>
								<sec:authorize ifAllGranted="ROLE_EMPLOYEE">
									<td>
										<form method="POST"
											action="<c:url value="/course/courseApprove"/>">
											<input name="seqId" type="hidden" value="${members.seqId }" />
											<input name="courseId" type="hidden"
												value="${course.courseId }" /> <input type="submit"
												value="승인" class="bt_view_small" />
										</form>
									</td>
									<td>
										<form method="POST"
											action="<c:url value="/course/courseDeny"/>">
											<input name="seqId" type="hidden" value="${members.seqId }" />
											<input name="courseId" type="hidden"
												value="${course.courseId }" /> <input type="submit"
												value="거절" class="bt_view_small"/>
										</form>
									</td>
								</sec:authorize>
							</tr>
						</table>
					</c:forEach></td>
			</tr>
		</table>

		<sec:authorize ifAllGranted="ROLE_STUDENT">
			<p align="center">
			<form method="POST" action="<c:url value="/course/courseRequest"/>">
				<input name="memberId" type="hidden"
					value="<sec:authentication property="name" />" /> <input
					name="courseId" type="hidden" value="${course.courseId }" /> <input
					type="submit" value="과정신청" class="bt_view" />
			</form>
		</sec:authorize>


	</section>
</div>